<!DOCTYPE html>
<html>
  <head>
    <title>Device Properties Example</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="format-detection" content="telephone=no" />
    <!--<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="css/website.css" />
    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

				// Wait for Cordova to load
				//
				document.addEventListener("deviceready", onDeviceReady, false);

				// Cordova is ready
				//
				 var watchID = null;
				function onDeviceReady() {
					navigator.geolocation.getCurrentPosition(onSuccess, onError, { maximumAge: 8000, timeout: 15000, enableHighAccuracy: true });
					watchID = navigator.geolocation.watchPosition(onSuccess, onError,  { frequency: 5000 });
				}

				// onSuccess Geolocation
				//
				function onSuccess(position) {
					var element = document.getElementById('geolocation');
					element.innerHTML = 'Latitude: '           + position.coords.latitude              + '<br />' +
										'Longitude: '          + position.coords.longitude             + '<br />' +
										'Altitude: '           + position.coords.altitude              + '<br />' +
										'Accuracy: '           + position.coords.accuracy              + '<br />' +
										'Altitude Accuracy: '  + position.coords.altitudeAccuracy      + '<br />' +
										'Heading: '            + position.coords.heading               + '<br />' +
										'Speed: '              + position.coords.speed                 + '<br />' +
										'Timestamp: '          +                                   position.timestamp          + '<br />';
				}

				// onError Callback receives a PositionError object
				//
				function onError(error) {
					alert('code: '    + error.code    + '\n' +
						  'message: ' + error.message + '\n'+
						  'info  :  ' + '信号比较差，请到空旷地再试试！');
				}

    </script>
  </head>
  <body>
    <p id="geolocation">Finding geolocation...</p>
  </body>
</html>

